package com.itheima08;

/**
 * @author Xiao
 * @date 2021/7/9
 */
public class StaticDemo {
    public static void main(String[] args) {
        //通过类名或者对象调用static修饰的变量，所有成员共享
        //推荐使用类名调用
        Student.school = "传智大学";
        Student stu1 = new Student();
        stu1.name = "阿良";
        stu1.age = 24;
//        stu1.school = "传智大学";
        Student stu2 = new Student();
        stu2.name = "平安";
        stu2.age = 21;
//        stu2.school = "天津大学";
        stu1.show();
        stu2.show();
    }
}
